/**
 * 系统用户查看js
 */
var chgLogUserLook = {
	key:"ChgLog_key_",
	dataCache : null,

	startEvent : function() {
		chgLogUserLook.showInfoById();
	},

	showInfoById : function() {
		var id= art.dialog.data('lokId'); // 修改id
		
		var key = chgLogUserLook.key + id;
		var record = eval('(' + localStorage.getItem(key) + ')');

		var beforeImage =eval('(' +  record.beforeImg+ ')');

		var afterImage =eval('(' +  record.afterImg+ ')');
		
		for(var i in beforeImage){
			var textBf=beforeImage[i];
			var textAf=afterImage[i];
			if(i=='entryTime'||i=='leaveTime'||i=='birthday'){
				textBf=textBf==null?'':(new Date(textBf)).format('yyyy-MM-dd');
				textAf=textAf==null?'':(new Date(textAf)).format('yyyy-MM-dd');
			}else if( i=='level'){
				textBf=jsUtils.getDictionaryTxtByType(i, textBf);
				textAf=jsUtils.getDictionaryTxtByType(i, textAf);
			}else if( i=='isInside'|| i== "closeAccount"){
				textBf=(textBf==1?"是":"否");
				textAf=(textAf==1?"是":"否");
			}else if( i=="onType" ){
                textBf=(textBf==1?"离职":"在职");
                textAf=(textAf==1?"离职":"在职");
			}
			
			$('#com-addForm td[name="'+i+'"]').html(textBf);
			$('#com-addForm td[name="'+i+'Af"]').html(textAf);
			if(textAf !=textBf){
				$('#com-addForm td[name="'+i+'Ch"]').html("已修改");
			}
			
		}
	},

	init : function() {
		chgLogUserLook.startEvent();
	}
}
$(document).ready(function() {
	chgLogUserLook.init();
});